﻿using System;
using System.Collections.Generic;
using System.Drawing;

namespace RussiaPostTracker
{
    class Program
    {
        static void Main(string[] args)
        {
            Bitmap image = new Bitmap("CaptchaImage.png");
            tessnet2.Tesseract ocr = new tessnet2.Tesseract();
            ocr.SetVariable("tessedit_char_whitelist", "0123456789"); // If digit only
            ocr.Init(@"tessdata", "eng", false); // To use correct tessdata
            List<tessnet2.Word> result = ocr.DoOCR(image, Rectangle.Empty);
            foreach (tessnet2.Word word in result)
                Console.WriteLine("{0} : {1}", word.Confidence, word.Text);

            Console.ReadKey();
        }
    }
}
